package drds.server.config.model;

/**
 * Mysql实例:IP+端口
 * 
 * @author 曹正辉<330937205@qq.com>
 */
public class MysqlInstanceInfo {

	/** 分布式数据库服务集群唯一ID */
	private final String id;
	private final String ip;
	private final int port;
	/** 获取数据库连接使用 */
	private final String url;
	private final String username;
	private final String password;

	private int minSize;// as init size
	private int maxSize;
	//
	private int weight = 100;

	public MysqlInstanceInfo(//
			String id,//
			String ip,//
			int port,//
			String username,//
			String password) {//
		super();
		this.id = id;
		this.ip = ip;
		this.port = port;
		this.url = createUrl(ip, port);
		this.username = username;
		this.password = password;
	}

	private static String createUrl(String ip, int port) {
		return null;
	}

	public int getMaxSize() {
		return maxSize;
	}

	public void setMaxSize(int maxSize) {
		this.maxSize = maxSize;
	}

	public int getMinSize() {
		return minSize;
	}

	public void setMinSize(int minSize) {
		this.minSize = minSize;
	}

	public String getId() {
		return id;
	}

	public String getIp() {
		return ip;
	}

	public int getPort() {
		return port;
	}

	public String getUrl() {
		return url;
	}

	public String getUserName() {
		return username;
	}

	public String getPassword() {
		return password;
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}

}